class AdStController < ApplicationController
  #权限验证
  before_filter :auth
  layout "admin"
  def index
    redirect_to :action=>'list'
  end

  #查询广告
  def list
    #提交表单为post   
    @ads = AdStatic.find_by_sql("SELECT count(*)as ct,ad_id,ad_name,date_format(created_at,'%Y-%m-%d') as created_date FROM `ad_statics` GROUP BY date_format(created_at,'%Y-%m-%d'),ad_id,ad_name ORDER BY date_format(created_at,'%Y-%m-%d') desc LIMIT 0, 30")
    #功能名
    @titles = "广告统计列表"
  end

  #查询导量
  def list_guide
    @ges = GuideExec.paginate :per_page => $perPage, :page =>  params[:page],
      :order => "created_at desc"
    @titles = "导量查询"
  end
end
